package com.example.netactivity;

import androidx.appcompat.app.AppCompatActivity;

public class MyListActivity2 extends AppCompatActivity {
  /*  private Handler handler;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_list2);
        GridView listView = findViewById(R.id.gridview);
        String[] list_data = {"one","two","three","four"};
        List<String> mylist = new ArrayList<>(100);
        for(int i = 1;i<=100;i++){
            mylist.add("Item "+i);
        }
        //Adapter
        ListAdapter adapter = new ArrayAdapter<String >(this,android.R.layout.simple_list_item_1,list_data);

        listView.setAdapter(adapter);
        //listView.setEmptyView(findViewById(R.id.nodata));

        Handler handle = new Handler(Looper.myLooper()) {
            @Override
            public void handleMessage (@NonNull Message msg){
                if(msg.what == 7){
                    Bundle bundle = (Bundle)msg.obj;
                    //更新数据列表
                    ArrayList<String> list2 = bundle.getStringArrayList("mylist");
                    ListAdapter adapter = new ArrayAdapter<String>(MyListActivity2.this,);
                    listView.setAdapter(adapter);
                    //切换提示
                    listView.setVisibility(View.VISIBLE);
                    bar.setVisibility(View.GONE);
                }
                super.handleMessage(msg);
            }
        };
        Thread t = new Thread(new MyTask(handler));
        t.start();//MyTask.run();
    } */
}